package org.mdrtwell.reflection.dynamicproxy;

import java.lang.reflect.Proxy;

public class Client {
	public static void main(String[] args) {
		Subject realSubject = new RealSubject();
		Class clazz = RealSubject.class;
		DynamicSubject dynamicSubject = new DynamicSubject(realSubject);
		Subject subject = (Subject) Proxy.newProxyInstance(clazz.getClassLoader(),
				clazz.getInterfaces(),
				dynamicSubject);
		subject.request();
	}
}
